function mcpart=EsqintBMsq(pathnum)

intBMsq=zeros(51,1);
time=linspace(0,1/2,51)';
time2=linspace(0,1/2,5001);
for pn=1:pathnum
    disp(pn);
    getpath=ouprocess(0,0,0,1,5001);
    %getpath=ones(size(getpath));
    %BMsq=getpath;    %case1
    BMsq=getpath.^2; %case2
    for jj=1:51
        intBMsq(jj)=intBMsq(jj)+midptrule(BMsq(1:(jj-1)*100+1),1/10000)^2;
    end
end
fname='case4_2';
mcpart=intBMsq/pathnum;
save(fname,'mcpart')
% hold on
% plot(time,5/4*time.^4)
% %plot(time,1/4*(exp(2*time)-1).^2)
% plot(time,mcpart,'r-')


